//using System;
//using Castle.Windsor;
//using MvcContrib.Interfaces;
//using System.Collections.Generic;

//namespace MvcCms.Web.Ioc
//{
//    public class WindsorDependencyResolver : IDependencyResolver
//    {
//        private IWindsorContainer _container;

//        public WindsorDependencyResolver(IWindsorContainer container)
//        {
//            _container = container;
//        }

//        public WindsorDependencyResolver()
//        {
//            _container = new WindsorContainer();
//        }

//        public IWindsorContainer Container
//        {
//            get { return _container; }
//        }
//        public object GetService(Type serviceType)
//        {
//            return _container.Resolve(serviceType);
//        }

//        public IEnumerable<object> GetServices(Type serviceType)
//        {
//            return (object[])_container.ResolveAll(serviceType);
//        }
//        public Interface GetImplementationOf<Interface>()
//        {
//            return (Interface)GetImplementationOf(typeof(Interface));
//        }

//        public Interface GetImplementationOf<Interface>(Type type)
//        {
//            return (Interface)GetImplementationOf(type);
//        }

//        public object GetImplementationOf(Type type)
//        {
//            if( _container.Kernel.HasComponent(type))
//            {
//                return _container.Resolve(type);
//            }

//            return null;
//        }

//        public void DisposeImplementation(object instance)
//        {
//            _container.Release(instance);	
//        }
//    }
//}